package com.servlet;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.domain.OrderInfo;
import com.domain.User;
import com.service.orderService;

public class orderServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    public orderServlet() {
        super();
    }

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		orderService orderService = new orderService();
		HttpSession session = request.getSession();
		User myUser = (User) session.getAttribute("MyUser");
		ArrayList<OrderInfo> orderService2 = orderService.getOrderService(myUser.getUsername());
		
		session.setAttribute("orderInfo", orderService2);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
